{extend name="index/common"}
{block name="title"}{$find.name} - {:config('site.website_title')}{/block}
{block name="seo_keywords"}{$find.keywords}{/block}
{block name="seo_desc"}{$find.description}{/block}
{block name="body"}
<div class="main">
    {include file="index/mainl"/}
    <div class="mainR">
        <div class="brandnavbox">
            <h2>我要留言</h2>
            <div class="con">当前位置：<a href="/">首页</a>》<a href="/book">我要留言</a></div>
        </div>
        <div class="detailbox">
            <div class="xq">
                <div class="formBox">
                    <div class="inputbox">
                        <label><span>*</span>姓名</label>
                        <input class="name" name="" type="text" placeholder="请输入姓名"/>
                    </div>
                    <div class="inputbox2">
                        <label><span>*</span>内容</label>
                        <textarea class="content" name="" cols="" rows="" placeholder="请输入您要留言的内容"></textarea>
                    </div>
                    <div class="inputbox">
                        <label><span>*</span>手机号</label>
                        <input  class="mebile" name="mebile" type="text" placeholder="请输入手机号"/>
                    </div>
                    <div class="inputbox">
                        <label><span>*</span>验证码</label>
                        <img src="{:captcha_src()}" class="yzmimg" onclick="this.src=this.src+'?time='+Math.random()"/>
                        <input name="yzm" type="text" placeholder="请输入验证码" class="yzm"/>
                    </div>
                    <div class="inputbox">
                        <label></label>
                        <input name="" type="button" value="提交" class="btn1" id="submit"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<script>
    $("#submit").click(function () {
        var name = $(".name").val();
        var content = $(".content").val();
        var mebile = $(".mebile").val();
        var yzm = $(".yzm").val();
        $.ajax({
            type: "post",
            url: "/book",
            data: {name: name, content: content, mebile: mebile, yzm: yzm},
            dataType: "json",
            success: function (data) {
                if (data.code == 1) {
                    alert(data.msg)
                    location.reload()
                }else {
                    alert(data.msg)
                }
            }
        })
    })
</script>
{/block}
